package clearjerk.pic.view;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;

public class GameFrame extends JFrame {
	private static final long serialVersionUID = -6499907386086607974L;
	public static final int WIDTH = 1024, HEIGHT = 768;
	private GameCanvas canvas;

	public GameFrame(String s, BufferedImage pixels)
	{
		super(s);
		this.setBounds(new Rectangle(WIDTH,HEIGHT));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JPanel cPane = new JPanel(new BorderLayout());
		cPane.setBorder(new LineBorder(Color.BLACK, 5));
		setContentPane(cPane);
		this.setResizable(false);
		canvas = new GameCanvas(pixels);
		getContentPane().add(canvas);
		setLocationRelativeTo(getRootPane());
		setUndecorated(true);
		this.setVisible(true);
	}
	public GameCanvas getCanvas(){
		return canvas;
	}
	public void setPixels(BufferedImage img){
		canvas.setPixels(img);
	}
}